home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
326-350
/
disk_348
/
diseditor
/
dised.doc
< prev
next >
Wrap
Text File
|
1992-05-06
|
75KB
|
1,614 lines
disEd
THE dissidents TEXT EDITOR
by Jeff Glatt
NOTE: Set your editor's TAB width to 3 to read this document.
»»»»»»»»»»»»»»»»»»»»»»»»»»» TABLE OF CONTENTS »»»»»»»»»»»»»»»»»»»»»»»»»»
1). Introduction
2). Entering Text
3). Moving the Cursor
4). Commands
5). The Clipboard
6). Case of Commands
7). Repeating Commands
8). Aborting Input
9). Search Wildcards
10). Save/Load Files
11). Edit Buffer Size
12). Menus
13). Text Entry Modes
14). Word Wrap and Text Flow
15). Window Size
16). Multiple Editors
17). Keymaps
18). Function key Macros
19). Enabling Features within Macros
20). Load/Save Macros
21). Color Control
22). Printer Codes
23). Final Notes
24). Editor Versions
25). What's Available
»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»» INTRODUCTION »»»»»»»»»»»»»»»»»»»»»»»»»»»
1). Introduction
Yet another text editor! That's right, but with a few twists. This editor
was written because the programmers at dissidents needed a good, basic text
editor with numerous features, and it had to be a SMALL program to fit easily
on a development disk. Besides handling source code for products like Midi
Sample Wrench and SpeakerSim (there's the plug!), the editor needed features
useful for writing magazine articles and such. (In fact, Jim is using it to
write his Op Amp text book because of this editor's ability to handle large
files well).
Not being an EMACS fan, I decided to break with tradition and create an
editor that used ALL of the keys on the amiga (plus the mouse), rather than
limiting the command set to what was used back in the old days when terminals
didn't have cursor keys. Never having been weaned on those kinds of aberrations,
I decided to create a (hopefully) logical command set quite unlike the EMACS
or WORDSTAR "standards", neither of which is very efficient. Nor did I want
to sacrifice any lines of text for "status" or "command" areas.
This editor is not loaded down with menus and requesters, like some of the
bloated, heaving hulks of code that purport to be text editors at > 100K.
Mouse jockeys may not like this, but for those who realize the true power of
the keyboard, the method of issuing a command should seem very straight-
forward.
This is a RISC-based editor. (Reduced, Intuitive, Set of Commands). You
won't find 4 different ways to move the cursor 1 character to the left. In-
stead, there is a smaller set of only the most useful commands, and the
facility to create more elaborate commands based upon these.
Best of all, this text editor is really just a tiny front end over
what is bound to be of some interest to developers, the dissidents text_ed
library. Yes, ALL of the editing, display, file input/output, cursor posi-
tioning, commands, etc. are being accomplished within a fully-reentrant,
disk-based library. With just a half-dozen library calls, you can turn any
window into a full-blown text editor with all of the features about to be
described. You can "install" custom commands which "inherit" all of the
qualities of built-in commands, plus can be used in the extensive Function
Key macro processing that the library supports. If you ever wanted to write
some application that needed an integrated editor (i.e. a compiler or assem-
bler) but hated the thought of writing an editor, then this library is for you.
Best of all, this library (like all dissidents libraries) is completely coded
in 68000 assembly which is why it is less than 13K in size with all of these
features! I employ a technique known as aggressive optimization (you aren't
afraid of multiple entry points into a function, are you?)
Let me start by describing the features of the dissidents disED program
(which uses the text_ed library) since that is a simple example of using the
library.
»»»»»»»»»»»»»»»»»»»»»»»»»»»»» ENTERING TEXT »»»»»»»»»»»»»»»»»»»»»»»»»»»»
2). Entering Text
The display is typical enough. When using the default WorkBench colors,
an orange cursor shows where text is about to be entered. As you type keys,
the characters appear in white on a blue background window. If you continue
typing and eventually reach the window's right border, the display automati-
cally scrolls to the left so that you ALWAYS see the text that you are
entering.
This editor supports true TABS, and the TAB width is variable from 1 to 9
spaces. The TAB key inserts 1 tab character when pressed.
Pressing the RETURN or ENTER keys ends the current line (wherever the
cursor happens to be), and starts a new line.
The BACKSPACE key will erase the character BEFORE the cursor, moving all
subsequent chars in that line over to the left. You can BACKSPACE at the first
char of a line, thus combining the remaining chars with the preceding line.
The DEL key erases the character AT the cursor. If you DEL at the end of a
line, the next line will be "pulled up" to join the current line.
Of course, the SHIFT key gives upper case letters when held down (as does
CAPS LOCK), and the ALT keys yield special symbols.
That is all you have to know to enter text!
»»»»»»»»»»»»»»»»»»»»»»»»»»»» MOVING THE CURSOR »»»»»»»»»»»»»»»»»»»»»»»»»»»»»
3). Moving the Cursor
ALL cursor movement is done with just the 4 cursor (arrow) keys, the SHIFT,
ALT, and the mouse. That's all! Many editors have different command strokes to
move the cursor around, but who needs that? When you get used to the idea that
you can move the cursor anywhere via just 4 keys or the mouse, you will wonder
why so many editors waste code on anything else.
The use of the cursor keys is meant to be as logical as possible. Pressing
any one of the keys alone yields the SMALLEST movement in the indicated
direction. For example, pressing the up arrow moves the cursor UP 1 line.
Pressing the down arrow moves the cursor DOWN to the next line. Pressing the
left or right arrows move the cursor over 1 character in either direction.
Easy?
Holding down the SHIFT key while you press the arrows yields LARGER
movements. For example, pressing the up arrow while holding the SHIFT moves the
cursor UP to the previous page. SHIFT and down arrow scrolls to the next page
in the document. Pressing the left arrow with the SHIFT moves the cursor to
the beginning of the next word. Pressing the right arrow with the SHIFT moves
the cursor back to the beginning of the previous word.
Holding down the ALT key while pressing the arrows yields the LARGEST move-
ments in the indicated directions. Pressing ALT and the up arrow moves to the
beginning of the document. ALT and down moves to the end of the document.
ALT and left arrow moves to the end of the current line. ALT and right arrow
moves to the start of the current line.
So, remember. The arrow keys move the cursor in the indicated direction.
Just the single arrow to move a tiny bit. Hold down the SHIFT to move a little
farther. Finally, hold down the ALT to take that big step. You'll see that
after 10 minutes or so, you'll hate editors that use keys other than the
arrow keys to move the cursor.
Finally, you can use the mouse to move the cursor. Just point at the place
where you want the cursor to be, and click the select (left) button.
»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»» COMMANDS »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»
4). Commands
This editor has a variety of commands to edit, search, replace, delete,
copy, cut, paste, format, save, and load blocks of text.
ALL commands use the CTRL (control) key in combination with one other
key. That's it!
For example, holding down the CTRL key and pressing the d key will delete
the current line.
If any commands require further input from you, the title bar of the
window turns into an appropriate prompt, and you enter text there. No bogus
command lines at the bottom of the screen that need to be invoked by the
ESC key. All error messages appear in the title bar of the window. Honest.
You don't have to even poke at any damn requesters to make them go away and
allow you to continue. Also, you can use the arrow keys along with the DEL
and BACKSPACE keys to "edit" your command's input. No more "BACKSPACE over
everything because you typed one letter wrong" command lines. Holding the CTRL
key while pressing x will delete any input previously entered via the titlebar.
The save and load operations use the dissidents FileIO requester library
which is a public domain file requester with features too numerous to mention
here. It also is written in assembly and is about 10K in size. Consult the
Fred Fish catalog for docs or write to the address given later.
Here is a list of the available commands and what they do:
Remember, you hold down the CTRL key and press the indicated key.
f key - FORWARD SEARCH
Search for a certain pattern starting AFTER the current position of
the cursor. A prompt will appear in the window title bar asking you
to type in the pattern. Just start typing and press return when you
have your search string. The editor will find the next occurence of
that pattern in your document, and place the cursor at it. If there
is no next occurence, the title bar will say:
"String not found"
See the sections on SEARCH WILDCARDS and CASE OF COMMANDS.
b key - BACKWARD SEARCH
This is just like the FORWARD SEARCH except that it looks for the
first occurence previous to the cursor position.
e key - EXCHANGE
This searches for the first occurence of a pattern in your document
and replaces it with a second pattern. You will be prompted to enter
a search pattern (just like with the FORWARD SEARCH). Enter the text
and press return. Now, you will see a prompt in the title bar asking
you to enter the replacement pattern. Enter the text and press return.
The editor will start at the beginning of the document and look for
the first occurence of the search pattern. When it is found, the
text at that location will be replaced with the exchange pattern. If
the search pattern is not found at all, the title bar will say:
"String not found"
For example, you might want to exchange the word "Mac" with "Amiga".
You might.
If, when presented with the "Exchange with >" prompt, you enter no
characters and press return, any search pattern will be removed
without an exchange being made.
See the REPEAT command.
q key - QUERY EXCHANGE
This is the same as the EXCHANGE command except for two differences.
1). It can exchange ALL occurences of the search pattern throughout
the file.
2). When it finds the search pattern, a message will appear in the
title bar saying:
EXCHANGE (q for quit)? (y or n) >
The editor waits for you to type a key before exchanging. Press
the N key if you want the editor to leave this occurence as is
but continue searching for more. Press the Y key if you want the
exchange to be made. Press the Q key if you don't want the ex-
change, and you also want to stop the search.
At this point, I want to mention that the editor saves your last search and
replace string, so that if you invoke the F key again for example, not only
will the "Search String >" prompt appear, but so will your last input. Simply
hit return if you want the same pattern. This is true even if you invoke sev-
eral other commands in the interim. If you don't want the same string, simply
hold down the CTRL key and press x to get rid of the old input. As if that
wasn't enough, check out this command:
g key - REPEAT COMMAND
This repeats the last command. If the last command required you
to enter any text via the title bar, this command will automa-
tically use that input INSTEAD of prompting you again.
CTRL-G works on ALL commands except the ENTER CTRL and UNDO
commands. As a further note, when you CTRL-G the EXCHANGE command,
it does not start the exchange from the beginning of the file.
Rather, it starts from the current cursor position.
d key - DELETE LINE
This deletes the entire line upon which the cursor is positioned.
r key - REMOVE TO END
This deletes all characters at and after the cursor up to the end
of the line.
l key - LINE JUMP
When invoked, a prompt appears in the title bar asking for the line
number to jump the cursor to. Type that in and press RETURN.
SPACE - DELETE SPACES
When you press SPACE while holding the CTRL key, all spaces at the
cursor up to the next non-space will be deleted. If the cursor is
not on a space, there is no effect.
TAB - TAB CONVERSION
When you press TAB while holding the CTRL key, as much whitespace
as possible in the document will be replaced by TAB characters,
(based on the TAB WIDTH setting). This can greatly reduce the size
of a file without changing it's appearence, and is useful for
compacting source code that was written without TABS. If you hold
down the SHIFT along with CTRL-TAB, then all whitespace will
be replaced with SPACE characters. This is useful if your printer
does not have a variable TAB width, and a certain document was
written with a different TAB width than your printer. Most printers
support at least a TAB width of 8 chars.
s key - STATUS
This simply presents some information in the window title bar such
as the current line number, the total # of lines in the file, and
how much room there is left in the edit buffer (i.e. how many more
chars can be entered.) Holding down the SHIFT key while pressing
CTRL-s will display the settings for LEFT and WRAP (right) MARGINS
as well as PAGE SCROLL and TAB WIDTH.
k key - CASE FLIP
This flips the case of the letter at the cursor. For example, if
the letter was a 'b', it is changed to a 'B'.
u key - UNDO
This undoes any edits to the current line, placing the cursor at
the start of the line. Please note that this doesn't undo commands.
It simply undoes any changes you may have typed in since moving the
cursor onto this line.
\ key - DOS command
When invoked, this asks you to type in a line of text just as you
might from the CLI, and executes that line in the CLI window from
which you may have invoked the editor. This is useful for invoking
an assembler or other program from within the editor. Just like
with the search/exchange strings, your input is remembered for
the next time you invoke this command, or use CTRL-G afterwards.
= key - ENTER CTRL
This editor supports entering (and viewing) control chars. When
you invoke the CTRL = combo, the editor awaits your NEXT keystroke
to be entered as a CONTROL code. The control codes are chars
@, a to z, [, \, ], ^, and _ for ascii values hex $00 to $1F.
For example, an ESC character is hex $1B. You would enter this
by pressing the CTRL and = keys, releasing those keys, and follow-
ing up with a press of the [ key.
A control code is displayed in reverse video. That is, instead
of being a white char on a blue background, the char appears as a
blue char on a white background. LineFeeds (J) and TABS (I) are
always presented as such and never displayed as a visible char.
So, to enter any control code, press the CTRL and =, then follow
with the appropriate character.
See the PRINTER CODES section.
` key - FILTER CTRL
This is used to remove control codes from the document. You will
be prompted to enter the one char (@, a to z, [, \, ], ^, or _).
The editor will filter the first occurence in the document.
Of course, you may use CTRL-G to repeat the command.
You cannot filter line feeds (RETURNS) from the document.
p key - PARAGRAPH FORMAT
This reformats lines from the current line to the end of the
paragraph according to the current LEFT and WRAP MARGIN settings.
After some deleting of characters, you may want to reformat an
entire paragraph. Move the cursor to the line where you wish the
reformatting to start. Press CTRL-p. If you start on the first
line of a paragraph and it is indented beyond the subsequent lines,
it may be necessary to format the first line and then move to the
second line of the paragraph and invoke CTRL-p again. This command
is also useful if you change the LEFT or WRAP margin settings, and
wish to reformat a paragraph to these new margins.
See WORD WRAP AND TEXT FLOW.
v key - UPDATE MENU
This updates the OPTIONS menu to indicate the state of certain
options (flags).
See the MACRO section.
z key - SET MARGINS
Pressing CTRL-z sets the LEFT MARGIN to the current position of
the cursor. Holding down SHIFT while pressing CTRL-z sets the
WRAP MARGIN to the current cursor position. See the MENUS section.
»»»»»»»»»»»»»»»»»»»»»»»»»» THE CLIPBOARD »»»»»»»»»»»»»»»»»»»»»»»»»
5). The Clipboard
The editor has a clipboard to which you can cut or copy blocks of text
from your document. You can also paste the contents of the clipboard at any
point(s) in the document. You can even save the contents of the clipboard to
disc, or load a file into the clipboard, thus importing/exporting text into
your current document.
To cut or copy a block of text from the document to the clipboard, you need
to define the start and end of the block. You do this using the cursor and the
mark. The cursor is visible, but the mark is not (unless you turn on the
Mark Display menu item). To set the mark, move the cursor to the place you want
the clip to start (or end), and use the MARK SET command. You do this by
holding the CTRL key (as with all commands) and pressing m.
m key - MARK SET
Sets the mark at the present position of the cursor. You will see
the message "Block Marked" in the title bar. (See Mark Display
for more information.)
Now, move the cursor to where you want the block to end (or start). Remember
to use the 4 cursor keys or mouse to move the cursor. Do not set the cursor
on the same character as where you set the mark.
At this point, you can copy or cut the block to the clipboard. Copy copies
the text to the clipboard without altering the document. Cut copies the text
and removes it from the document.
y key - COPY TEXT
Copies text between the mark and the cursor to the clipboard
without altering the document. You will see "Block copied to Clip"
if successful.
x key - CUT TEXT
Cuts text between the mark and the cursor to the clipboard
while removing it from the document.
Now that you have text in the clipboard, you can move the cursor to any
place in the document and insert the contents of the clipboard at that position.
i key - INSERT CLIP
This inserts the contents of the clipboard at the position
of the cursor. Contents of the clipboard does not change.
You can move to other areas of the document and continue to insert the
clipboard text.
o key - OTHER POSITION
Swaps the current position with the mark so that you can easily
jump back and forth between 2 points in a document.
There are a few things that you can do to the text in the clipboard.
h key - LOWER CLIP
Changes all upper case letters in the clipboard to lower case.
H key - UPPER CLIP
Changes all lower case letters in the clipboard to upper case.
Note that the UPPER CLIP command involves holding both the CTRL and the
SHIFT keys while pressing the h key. For most commands, it doesn't matter if
you invoke them in upper or lower case (i.e. with or without the SHIFT), but
a few commands do support a separate function for the SHIFTED version.
»»»»»»»»»»»»»»»»»»»»»»»»»»»» CASE OF COMMANDS »»»»»»»»»»»»»»»»»»»»»»»»»»»
6). Case of Commands
As mentioned, it usually doesn't matter if a command is invoked with the
SHIFT key held, but a few commands take on a new twist with the SHIFT.
Normally, string searches such as in the FORWARD SEARCH, BACKWARD SEARCH,
EXCHANGE, and QUERY EXCHANGE are case sensitive. That is, if you were search-
ing for "Duck" then the editor would not recognize "duCK" as being the same.
When you invoke any of the mentioned search commands with the SHIFT key
held down, then the search becomes case-insensitive. "Duck" matches "duCK".
Having the CAPS LOCK key on will not SHIFT commands. You must explicitly
hold down the SHIFT key when that is what you desire.
»»»»»»»»»»»»»»»»»»»»»»»»»» REPEATING COMMANDS »»»»»»»»»»»»»»»»»»»»»»»»»»»»
7). Repeating Commands
The last command that you issued can always be repeated once with the CTRL-G
command.
Alternately, there is a way to specify how many times you want a command
to be repeated when you issue the command. Simply hold down the ALT key along
with the CTRL key combo and a prompt will appear in the title bar:
Number of iterations >
Type in the number of total times to issue the command and press return.
The command will carry out as normal. If you need to enter input, you will
need to do so only on the first repeat. Subsequent repeats will use the same
input. For example, you might want to replace the first five occurences of
"computer" with "disaster".
Invoke the EXCHANGE command by pressing CTRL, ALT, and the e key. The
"Number of iterations >" prompt will appear. Type in 5 and hit RETURN. Next
the editor will prompt for the search string. Enter "computer" (minus the
quotes) and press RETURN. Finally, the editor will ask for the exchange
string. Type "disaster" and press RETURN. The editor will then replace the
first 5 occurences of "computer" with "disaster".
This method of specifying repeats by holding the ALT key will work with
all commands except CTRL-G, CTRL-U, CTRL-=, or CTRL-Q.
You can even CTRL-G a repeated command in which case the whole process
will be repeated, but without needing any input at all.
If the number of iterations cannot be satisfied (i.e. you ask to repeat
the FLIP CASE command 6,000,000 times), the command will execute as many times
as possible, and then stop.
>>>> IMPORTANT <<<<
You can abort a repeating command at any time by pressing the left (select)
mouse button anywhere inside the disED window.
When a command is repeating, the display is not updated until all possible
repeats have completed. In other words, if you repeat the DELETE LINE command
10 times, you won't see 10 lines disappear one at a time. Rather, the 10 lines
will disappear simultaneously since disEd won't update the display until after
the 10th line is deleted. Bear this in mind for commands that may take a while
to complete such as exchanging a word throughout a document. It will appear
as if disEd is doing nothing even though it may actually be performing
exchanges. When completed, the titlebar might read "String not found" and the
display would then be updated with the cursor at the start of the document or
at the last exchange.
»»»»»»»»»»»»»»»»»»»»»»»» ABORTING TITLE BAR INPUT »»»»»»»»»»»»»»»»»»»»»»»»»
8). Aborting Input
If the editor prompts you for input via the title bar and you wish to abort
the command at that point, press the ESC key. Macros and repeating commands
are aborted by pressing the right mouse button.
»»»»»»»»»»»»»»»»»»»»»»»»»» SEARCH WILDCARDS »»»»»»»»»»»»»»»»»»»»»»»»»»»»»
9). Search Wildcards
When typing in a string at the "Search String >" prompt, you may use a
special wildcard character, "*". The asterisk means that any character will
match. For example, say that you typed the following string for the search:
the b*g
All of the following would match:
the bug
the bag
the big
You can place several asterisks in a search string, even in a row. For
example,
t**k
could match these:
tank
talk
took
Because the * character is used as a wildcard, you should only use it in
this way when typing your search string.
»»»»»»»»»»»»»»»»»»»»»»»»»»» FILE SAVE/LOAD »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»
10). Save/Load Files
The file SAVE AS and LOAD features are accessed via the Project Menu. You
can save the contents of the clipboard or the edit buffer (your document).
You can also load a file into the clipboard or edit buffer. (When loading
into the edit buffer, the macro keys and all other config file settings
remain until you load another config file or exit disED.)
These operations bring up the dissidents FileIO requester. There are many
features that are fully described in documentation on previous Fish discs,
but briefly...
You select which disk you want to examine by clicking on the Next Disk
button until the name of the disk appears in the DiskName string gadget
OR
You press the right mouse button to reveal the list of available devices
and click the left mouse button over the desired name.
OR
You click on and type the name into the DiskName gadget.
Drawer names have a »» before them. Click on the name to enter the drawer.
The "Previous" drawer exits a drawer.
You select a filename by double-clicking on the desired name
OR
You type the name into the FileName gadget.
The FileIO requester has numerous features that you can customize (per
application) via the 10 function keys while it is open, but we won't go into
that here. For more information, contact dissidents.
The SAVE menu item will simply save the edit buffer with the same name as
you last used when saving the edit buffer. The file requester is not invoked.
If you initially run DisED from a CLI, it takes one argument: the name of
the file to load. This then becomes the name that SAVE uses until you save the
edit buffer with a new name using SAVE AS.
From Workbench, if you double-click on an Icon for a file that was made
using disED, the version of disED you used to make that file will be invoked,
and the file will be automatically loaded.
»»»»»»»»»»»»»»»»»»»»»»»»» SIZE OF EDIT BUFFER »»»»»»»»»»»»»»»»»»»»»»»»
11). Edit Buffer Size
A document is entirely loaded into memory, and all edits that you make are
performed on this copy in memory. If you wish to make these edits permanent,
you must save the file (via SAVE or SAVE AS File). The memory that the document
is loaded into is called the edit buffer. When started, disED obtains a
default edit buffer whose size is set to a percentage of available memory, or
the setting within a config file. There is a menu item that allows you to
resize the buffer (i.e. perhaps make it larger if you fill it up). Whenever a
document is loaded, disED tries to insure that the buffer is large enough for
the text plus room for a reasonable number of edits. A good approach is to
set the edit buffer size to the average size of the documents that you edit
plus a little more. For example, if your documents tend to be about 50,000
bytes, set the edit buffer size to 60,000, and save a config file. This will
insure that disED uses only as much memory as it truly needs, and makes multi-
tasking with disED quite easy. Note that if you then load a document larger
than the buffer size, disED will automatically adjust its buffer larger. In
the event that you see the message "File truncated" when loading a file, this
means that disED could not find a memory chunk large enough to load the entire
document, and has truncated it. You will have to close down other applications
and reload the document.
»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»» MENUS »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»
12). Menus
The menu items to LOAD and SAVE were previously mentioned.
CLEAR - Clears out all of the text in the edit buffer (but not the clipboard).
QUIT - Exits the program. If you made any changes to the document, the editor
will ask if you really want to quit. Answer no if you wish to SAVE
the edit buffer first.
Alternately, the ESC key will exit the program. If any changes have
been made, the file will be saved using its last saved name without
requiring your response.
RESIZE EDIT - Normally, the edit buffer is set to a percentage of available
memory or the setting within a config file. If you wish to
resize it (maybe make it larger if you fill it up), do so with
this command. Enter the new size (in bytes). Always save your
present text before using this item, even though the editor will
try to copy your present text into the new edit buffer.
TAB WIDTH - Sets the true TAB width from 1 to 9 spaces. Defaults to 8.
PAGE SCROLL - Sets the number of lines to scroll when the SHIFT-UP or SHIFT-
DOWN arrows are pressed. Defaults to 23 lines scroll per page.
LEFT MARGIN - Sets the number of leading spaces at the beginning of each line.
(i.e. the amount to initially indent each line). If LEFT MARGIN
is set to 0, then no leading spaces appear on each line. You
may always backspace over to the window's left edge despite
any LEFT MARGIN setting. MAX value is 127.
WRAP MARGIN - Sets the number of characters on each line before word wrap
occurs. Only effective when WORD WRAP is on. This setting
includes the LEFT MARGIN. For example, If Left Margin is set to
5 and Wrap Margin is 20, you can fit 15 characters on a line
before word wrap will occur. MAX value is 253, but the WRAP
MARGIN cannot be less than the LEFT MARGIN.
PROTECT - When this is on (checked) a file is protected from being
edited. New text cannot be entered, nor can any command be
issued that will alter the document.
SAVE/LOAD
CONFIG - Used to save and load a configuration file. This is a file that
stores "settings" such as the TAB width so that when disED is
run, it will automatically use your customized settings saved in
a config file. BOOT DISK will save the config file to the disk
that you booted from. CHOOSE DIR allows you to save a config
file anywhere under any name. When disED starts up it first
looks for a file named DisConfig in the current directory. If
there is none, it then looks for the same name on your boot
disk. In this way, you can have a generic config file named
DisConfig on your boot disk which can be overwritten by
DisConfig files in certain directories. (You may want WORD WRAP
for writing letters but not for writing programs.) You can even
save config files not named DisConfig, in which case disEd will
ignore them until you specifically load one via CHOOSE DIR under
LOAD CONFIG. You can load a config file at any time. The CHOOSE
DIR item uses the FileIO requester to obtain your filename.
Settings that the config file saves are TAB width, Page Scroll,
all 30 Function key macros, text entry modes, block search, mark
display, word wrap, window size/location, screen colors,
margins, auto-indent, the rebinded keys, protect, hide codes,
no icon, extra wide, and the last DOS command executed in the
editor. Also saved is the FileIO's match string, tooltypes,
and flags (settings).
Before saving a config file, you should set up the editor
exactly as you would like it to initially open by setting up
all of the preceding parameters, and setting up the file
requester with the desired features.
MARK DISPLAY - Highlights the lines inbetween the mark and the cursor so
that you can see what text is involved. With this on, the
CTRL-M command toggles the mark on and off. You will see
"Block Cleared" when the mark is removed.
BLOCK SEARCH - This limits searches to only those characters inbetween the
mark and the cursor, rather than searching the entire file.
Use this if you want to confine searches to a certain block
of text, such as searching only 1 line or 1 paragraph.
BLOCK SEARCH also effects the EXCHANGE, QUERY EXCHANGE, and
FILTER CTRL commands so that you can also confine exchanges
to the text inbetween the mark and cursor.
To use this, set the mark where you want the start (or end)
point. Now, move the cursor to the end (or start) point by
clicking the mouse or using the cursor keys. Make sure that
BLOCK SEARCH is on. Now when you issue any search or ex-
change command, it will only effect this text, even if you
repeat the command 6,000,000 times.
WORD WRAP - Automatically starts a newline when a line's length exceeds the
Wrap Margin. It breaks the line inbetween two words, placing
the second word on the new line with the cursor at the end.
AUTOINDENT - When you press RETURN, the next line is automatically indented
by the same amount as the previous line. This is useful for
programming languages such as C. The ENTER key (on the numeric
keypad) normally functions like the RETURN key except when
AUTOINDENT is on. In this case, the ENTER key does not auto-
indent, so that you have the option of making a new line
not auto-indent even in this mode.
When LEFT MARGIN is not zero, a line will always be indented
by at least that amount.
EXTRA WIDE - When enabled, the lines of text on the display are separated
more, so that it may be easier to read a "dense" document.
Note that this only affects the display. The document is com-
pletely unchanged. (i.e. a document printed out will look the
same regardless of the EXTRA WIDE setting). In EXTRA WIDE mode,
the display will flash when scrolling text into view.
See PRINTER CODES.
NO ICON - When saving a file, disED usually saves an icon for WB users.
With NO ICON on, disED won't save an icon when it saves files.
disED never saves icons for config files, saved clips, or macros
- just the viewed text file.
»»»»»»»»»»»»»»»»»»»»»»»»» TEXT ENTRY MODES »»»»»»»»»»»»»»»»»»»»»»»»»»»»»
13). Text Entry Modes
Normally, disED is in Insert mode. What this means is that when you enter
new text, subsequent chars are pushed to the left to make room for the new
text.
disED also supports OverStrike mode. In this mode, subsequent chars are
not pushed over. Instead, the new text overwrites any subsequent chars, for-
ever banishing them to computer hell, where everyone uses CP/M.
disED implements a 3rd mode, ExtendedOverStrike. In this mode, new text
only overwrites to the end of a word, then temporarily kicks into insert mode
so that chars append to the word instead of overwriting the next word. This
mode is ideal for editing documents since you can quickly correct a misspelled
word or add text without clobbering subsequent words. Note that
ExtendedOverStrike supercedes OverStrike Mode.
Of course, the 4 arrow keys and mouse operate the same in all 3 modes.
»»»»»»»»»»»»»»»»»»»»»»»» WORD WRAP AND TEXT FLOW »»»»»»»»»»»»»»»»»»»»»»»
14). Word Wrap and Text Flow
disED implements "text flow" when using word wrap. What this means is that
instead of just flopping the overflowing text onto a new line, disED reformats
the entire paragraph to best "fit" inside of your margins. You MUST separate
paragraphs in either of two ways:
1). Indent the first line of the paragraph past the LEFT MARGIN.
2). Place a blank line before the paragraph (i.e. press an extra RETURN
before starting a new paragraph).
Because of "text flow", you can set the WRAP MARGIN to the desired number
of characters per line, turn on WORD WRAP, and only have to press RETURN at
the beginning of a new paragraph. You don't have to press return after every
line because disED will insure that each line doesn't exceed the MARGIN, and
that the paragraph is formatted properly. This is true even if you later add
text in the middle of a paragraph.
An efficient approach for writing documents, letters, reports (as opposed
to writing program code), is to set up WORD WRAP, and type in your text without
bothering with corrections. Then, enable Extended Overstrike and move the
cursor to where you want to add or change text. Type the new text. Extended
Overstrike will insure that you don't clobber the next word, and "text flow"
will reformat your paragraph automatically. If any corrected misspelling is
shorter than the original mistake, use the DEL key to remove unwanted
characters, and then issue the reformat paragraph command.
As a further suggestion, you might program a macro key to insert a RETURN
followed by SPACES or TABS. You can then start a new paragraph by pressing this
macro key once.
Because of the way in which WORD WRAP is implemented, you should keep lines
shorter than 128 characters. Two adjacent sentenses whose total length is >
256 characters will wrap into more than 2 sentenses.
»»»»»»»»»»»»»»»»»»»»»»»»»»»» WINDOW SIZE »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»
15). Window Size
disED has a window sizing gadget in the bottom right corner so that you
can resize the window to any dimensions. The appropriate amount of text will be
shown in the window, while still retaining the feature of being able to scroll
to any text offscreen whether it be up, down, left, or right.
»»»»»»»»»»»»»»»»»»»»»»» MULTIPLE EDITORS/WINDOWS »»»»»»»»»»»»»»»»»»»»»»»
16). Multiple Editors
When a disEd editor is started, its number is displayed first in the title
bar of its window. For example, the first editor you start will have a
1 >
in the title bar. If you run another invocation of disED, that editor's title
bar will read:
2 >
and so on. You can send the clipboard of one editor to another using the
TRANSFER CLIP command (CTRL-t). A prompt will be displayed asking you for the
editor number to send the clipboard to. Type in the number and press return.
(A default editor of 1 initially appears. Use CTRL-x to erase this if you
desire another editor). The clipboard will be transferred to the other editor.
The sending editor will then have an empty clipboard, and the receiving editor's
clipboard will have the transferred contents.
Do not attempt to transfer the clipboards of two editors to each other
simultaneously!
The disED windows are simple refresh so that memory requirements are kept
to a minimum at all times.
»»»»»»»»»»»»»»»»»»»»»»»»»»»»»» KEYMAPS »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»
17). Keymaps
disED will use whatever keymap that your system is setup for, except that
the function and cursor keys always operate as described in this document.
»»»»»»»»»»»»»»»»»»»»»»»»»» FUNCTION KEY MACROS »»»»»»»»»»»»»»»»»»»»»»»»»»»
18). Function key Macros
One of the most unique features of disED is the way in which the function
key macros work. You can tie a whole series of commands to a single function
key, as well as move the cursor, enter text into the document, and access
menu items all within the same macro. You can save and load individual macros,
and edit macros.
There are 30 macros total: The 10 Function keys alone, the 10 Function
keys with the SHIFT key, and the 10 Function keys with the ALT key.
To set up a function key, hold the CTRL along with the combo desired.
For example, you might press the CTRL, SHIFT and F1 to set up the first of
the 10 SHIFTED function keys.
The window title bar will read "Function String >". You are now going to
enter a series of characters to describe the operation, and then hit return.
If there was already a macro defined for this key, it will be shown so that you
can edit it or enhance it. (You can delete all chars with CTRL-x to clear
the function key of any macro, or just press ESC to leave it as is).
Let me first give you a general description of how to define the macro,
and then some examples.
Cursor movement is defined by letters inbetween two brackets [ ].
A Menu selection is defined by numbers inbetween two braces { }.
Text to be inserted into the document (or used as an argument for
a command) is in double quotes " ".
Commands (CTRL key combos) are simply letters not inside of any delimiters.
A ? causes the macro to get input from the user.
The < > keys can be used to loop parts of a macro.
Here are the letters to use to describe cursor movements.
a - UP arrow e - SHIFTED UP i - ALT UP
b - DOWN arrow f - SHIFTED DOWN j - ALT DOWN
c - RIGHT arrow g - SHIFTED RIGHT k - ALT RIGHT
d - LEFT arrow h - SHIFTED LEFT l - ALT LEFT
Now let's define a simple macro that moves the cursor down one line, and
then to the end of the line. Make sure that you are not in OverStrike mode
for these examples. Press the CTRL and F1 key to define function key 1.
Enter the following text (no spaces) and press return.
[b][k]
Notice that I put a "b" inbetween brackets. The brackets mean that this is a
cursor movement. The b stands for the DOWN arrow key without the SHIFT or ALT.
That moves our cursor down one line. Next is a "k" inbetween brackets. Once
again, the brackets indicate a cursor movement. The k stands for the RIGHT
arrow key with ALT held down. This moves us to the end of the line, remember?
Now, when you press the F1 key, the cursor should move down 1 line, and to
the end of the line. (To test, you should have a document loaded with the cursor
not on the last line since it cannot move where there aren't entered characters.)
When you have several cursor movements in a row, you can place them all
within one set of brackets. This makes for smaller, more efficient macros.
Thus the preceding example would abbreviate to this:
[bk]
You should never have spaces (outside of quotes) in a function key macro
(unless you mean to execute the DELETE BLANKS command).
Now let's add to our macro. Press CTRL and F1. You should see the macro that
we just defined. Using the cursor keys, abbreviate it by removing the extra
inside brackets. Now let's insert the word "Hello!" after we move the cursor
down one line and to the end of the line. To insert text, we inclose it in
quotes. Here's our new macro:
[bk]"Hello!"
Press return to enter the macro, then move the cursor to the start of your
document. Press F1. Did the cursor move down and to the end of the 2nd line,
then write Hello! ?
Finally, let's move the cursor to the start of the next line by adding a
RIGHT cursor movement at the end of the macro (i.e. by then the cursor will be
at the end of the line). Then we'll execute the FLIP CASE command. The FLIP
CASE command is the letter k. Notice that I don't put the letter in quotes,
brackets, or braces because it is intended as a command. Invoke the setup of F1
with CTRL and F1, and type:
[bk]"Hello!"[c]k
Press return, position to the start of the file and press F1. See how it works?
It should have flipped the case of the first letter on the 3rd line (assuming
that it was a letter).
Now then, maybe you wanted to invoke the FLIP CASE command 11 times. You
could do this:
[bk]"Hello!"[c]kkkkkkkkkkk
but since any command can be preceded by a number telling how many times to
execute (repeat), you'll do this:
[bk]"Hello!"[c]11k
In fact, you can place a number in front of any cursor movement as well.
Try to guess what the following macro does:
" = 5"[4d]"3 + 2"[5d3b]
Did you guess that the chars " = 5" (minus the quotes) were inserted wherever
the cursor happened to be, then we backed up 4 chars and inserted "3 + 2" in
front of the " = 5", then moved the cursor back to where we started and down
3 lines? Analyze this example carefully before moving on.
Some commands need input, such as the FORWARD SEARCH. In a macro, you place
the input for the command directly after the command, and in quotes. You MUST
supply all necessary input directly in the macro (unless you substitute a ?).
The FORWARD SEARCH (f key) command needs a search pattern. Here is an example
macro:
15f"computer"
Did you realize that this macro would locate the 15th occurence of the
string, computer, after our present cursor position? If there were less than 15
occurences, it would end up on the last one with the message "String not found"
in the title bar. If there were no occurences, the cursor would stay where it
started and you would see the error message. This brings up an important point.
When commands issue an error message (as opposed to an informational message
such as "Block Marked"), the macro aborts AT THAT POINT. In this way, you can
do string searches/replaces and trust the rest of the macro to execute only if
a successful find, for example.
Things that may abort macros are as follows:
Search or Replace functions can't find any more occurences of the search
string.
The mark has not been set prior to copying or cutting to the clipboard, or
the cursor is at the same position as the mark for these operations.
There is no more room in the edit buffer to insert characters.
There is no mem for clipboard operations.
A file didn't load or save correctly.
A DOS command failed.
Tried to insert a Control code that wasn't one of the accepted ascii chars.
Issued an unknown command.
The edit buffer couldn't be resized.
You reached the last or first char in the edit buffer for commands such
FLIP CASE.
You reached the last or first char in the edit buffer when moving the
cursor (for example, trying to issue a SHIFT-RIGHT when you are already at
the last word in the document).
You pressed the ESC key when directly entering text via the window title
bar. (i.e. aborted title bar input)
Protect mode is on, and you tried to alter the text or issue a command
that alters the text.
When any errors cause a macro to fail, you should see an appropriate error
message in the titlebar. A macro that fails without an error msg is probably
incorrectly written (i.e. a syntax error).
>>>> IMPORTANT <<<<
You can abort an executing macro at any time by pressing the left (select)
mouse button. (This is the same way that you abort a repeating command).
You can cause parts of a macro to repeat by placing the symbols < > around
the part of the macro that you want to repeat, and placing the number of
repeats before the first <. For example,
5<"Hello ">
This prints "Hello " (minus the quotes) 5 times.
10<f"me"k>2<d[2a]>
This macro does the following 10 times.
1). Finds the next occurence of "me".
2). Flips the case (capitalizes) the first letter "m".
Then it does the following twice.
1). Deletes a line.
2). Moves the cursor up 2 lines.
You cannot imbed < >. For example, this is not legal:
2<[a]4<d>>
At this point, you may be starting to squint your eyes at this rather crytic
stream of letters, but you should also notice how much power is packed into
such a small group of characters. This is why disED macros execute FAST...
faster than other forms of interpretive macros...and MUCH MUCH faster than
ARexx. They are also quite compact. If you take the time to study the method,
you'll discover a lot of flexibility...and we haven't even started to discuss
the more powerful features.
Here's a macro that replaces every instance of "me" with "you" asking you
if you want to exchange each instance. We'll use the QUERY EXCHANGE command
(q). Note that this command needs two strings of input, the search string and
the exchange string.
q"me""you"
Note that each string has its own quotes (to separate it from the other
string). Now when you execute the macro, you'll note that as it finds an
occurence of "me", it displays the prompt:
EXCHANGE (q for quit)? (y or n) >
This is another point. A YES/NO prompt that is issued by a command never
gets its input from a macro. It always goes to you. So never do this:
q"me""you""y" don't put your y for YES in the macro!
An alternative to placing text inbetween double quotes, is to substitute a
? (the direct input specifier). The ? tells disED to get the input from you.
For example,
q?"blort"
When you execute this macro, a prompt will appear in the title bar:
Search String >
This is because we substituted a ? in place of the first (search) string in
double quotes. You can type any string in, press return, and then disED will
exchange that string with the second (exchange) string "blort".
Also, you can invoke direct input to enter text manually during macro
execution. For example,
"The answer ="?" inches."[l]
This one prints "The answer =" and then kicks into direct input mode. You
can then enter text, move the cursor about, BACKSPACE, DELETE, press return,
etc. The mouse pointer will remain as a WAIT pointer to remind you that you
are still inside of a macro. To exit this mode, you press the ESC key, and
disED continues on with the rest of the macro. In this case, it prints
" inches." wherever you left the cursor, and then goes to the beginning of
that line. When in direct input mode, you can't use the mouse to move the
cursor, nor access the menus - just input/edit text and use the cursor keys.
In conclusion, anywhere that you might place text inbetween double quotes,
you can instead place the ? (direct input) specifier to enter chars "on the
fly".
The ? and the <> macro repeats are particularly useful with the exchange
commands. Let's say that you have a generic form letter, and wherever you need
to put new info (names, addresses, phone numbers), you have placed 10 underscores.
For example, where the person's address would appear at the top of the letter,
you have the following:
__________
__________
__________
Now, study the following macro.
[i]100000<f"__________"e"__________"?>
When you invoke the macro, it first goes to the start of the file because
of the [i]. When you use the EXCHANGE command (e) in a macro, it always starts
the search from the current cursor position, not from the start of the file.
In this case, since we want to start our search from the beginning of the
file, we need to first move there. Next, the macro does the following:
1). Finds the next occurence of the 10 underscores, placing the cursor there
for you to see.
2). Displays a prompt in the title bar asking you to enter the exchange
string (to exchange for the 10 underscores).
Now, for the first exchange string, type in the person's name and press
RETURN. For example, the file might now read:
Jeff Glatt
__________
__________
disED will immediately jump to the next 10 undersores, and prompt for an
exchange string to replace the underscores. Press CTRL-x to get rid of
the name, type in the address, and press RETURN. The file might read:
Jeff Glatt
6 Sycamore Drive East
__________
disED will jump to the next 10 underscores, and prompt for another exchange
string, etc. This will continue for 100000 exchanges of the underscores, or
until disED cannot find anymore occurences of the 10 underscores. If you have
WORD WRAP on, disED will even reformat your paragraphs as you go along.
As you can see, this makes for easy editing of letters and forms.
Examples of commands that need arguments are as follows:
EXCHANGE needs a search and exchange string. e" find me ""switch to me"
QUERY EXCHANGE same as EXCHANGE
FILTER CONTROL needs a control char and exchange string `"M"""
Note how the FILTER example has nothing "inside" of the 2 quotes for the
exchange string. When you specify an "empty" exchange string in any of the
EXCHANGE, QUERY, or FILTER functions, any occurence of the search string is
removed from the file without substituting any exchange.
In direct input, if you simply press return without entering any characters
at the "Exchange String >" prompt, it will accomplish the same thing. Remember,
anytime you want to abort title bar input, press ESC.
LINE JUMP needs a line number l"30"
Remember that all arguments to commands are in quotes, or the ? char!
FORWARD SEARCH needs a search string f"find this"
BACKWARD SEARCH needs a search string 10b"find 10th one back"
DOS COMMAND needs a CLI line \"dir df0:"
The ENTER CONTROL (=) command is a special case. Its argument isn't enclosed
in quotes. Instead you place the char to be entered after the command. There
are 2 important control codes you'll enter often. One is a TAB. This is
specified as =I . The other control code is a RETURN (=J).
Here is an example of printing a RETURN, followed by "Hello", followed by
a TAB, and finally another RETURN.
=J"Hello"=I=J
If you need to insert a double-quote sign (") in the text, it must be
followed immediately by a front slash (/). Think of this combination "/
as a single, double-quote char to be inserted into the text, So this macro,
""/hello"/"
will result in the following being inserted into your document:
"hello"
Now let's talk about accessing disED's menus from macros. You'll notice that
disED has 3 menus, PROJECT, SETUP, and OPTIONS. PROJECT is menu #1, SETUP is
menu #2, and OPTIONS is menu #3. Each menu has several items. For example,
the PROJECT menu has 5 Items with CLEAR being item #1 and QUIT being item #5.
You'll notice that some items, like SAVE AS, even have subitems. For SAVE AS,
FILE is subitem #1 and CLIP is subitem #2.
A menu event is described in a macro by specifying the menu, item, and
any subitem number separated by commas and inbetween braces. For example, if
we want to select WORD WRAP item in the OPTIONS menu, place the following in
a macro:
{3,3,1}
The first three means "go to the 3rd menu" which is the options menu. The
second three means "select the 3rd item" which is the WORD WRAP. The final 1
stands for the subitem number, which is ignored since WORD WRAP doesn't have
a subitem. Actually, you don't need the subitem field. If you omit it, a subitem
of 1 will be assumed. Thus the following macro is equivalent.
{3,3}
Some menu items/subitems need input which you must supply in quotes after
the menu event. This is like commands that require input. Examples are
LOAD FILE needs a filename {1,2}"df0:s/startup-sequence"
This loads the file, Df0:s/startup-sequence, into the edit buffer.
LOAD CLIP needs a filename {1,2,2}?
Loads the filename that you enter (via the file requester because of the
?) into the clipboard. Note that I had to specify the subitem here, since it's
not 1.
SAVE AS FILE needs a filename {1,4}"ram:tempname"
SAVE AS CLIP needs a filename {1,4,2}"df0:extras/poot/myname"
RESIZE EDIT needs buffer size in bytes {2,1}"10000"
TABWIDTH needs a number 1 to 9 {2,2}"3"
PAGESCROLL needs a number 1 to 99 {2,3}"23"
WRAP MARGIN needs a number 1 to 253 {2,4}"59"
SAVE CONFIG's CHOOSE DIR needs a filename {2,5,2}"df1:myconfig"
Note that SAVE CONFIG BOOT DISK doesn't need an arg {2,5}
LOAD CONFIG CHOOSE DIR as above
No arg for LOAD CONFIG BOOT DISK
None of the items in the options menu need args.
Here are a few more useful macros followed by descriptions. Make sure that
you understand these before trying your own since an incorrectly written macro
may do some dangerous things what with controlling menus and sending DOS cmds.
{1,4}"ram:main.c"\"cc +p ram:main.c" Saves the edit buffer as ram:main.c
and invokes the Manx compiler on it
[k]=j=i"move.l"=i Moves to the end of the current line, starts a new line
prints a TAB, prints "move.l" followed by another TAB
2=I"{"=J3=I=J2=I"};"[ak] This macro is of good use to C programmers.
Enter it in a function key, move to a blank
line, and invoke the function key!
m[g]x This deletes from the current cursor position to the beginning of
the next word. If the cursor is at the first letter of a word,
then that word would be deleted.
[h]m[g]x This deletes the word previous to the word upon which the
cursor now sits.
[k]m[l]q"cursor""mouse pointer"[kd]
This macro searches only the current line for all instances
of "cursor" and asks if you want to replace them with "mouse
pointer", then moves to the beginning of the next line if you
did not quit the QUERY EXCHANGE (aborts the macro). Note that
this macro only works if you enable the BLOCK SEARCH feature
of the OPTIONS menu, and turn MARK DISPLAY off.
As you may begin to see, the Function keys can be used to "create" new
commands which disED doesn't normally support as a single keystroke.
Whether you enter macros in upper or lower case is inconsequential except
for those commands that make use of SHIFT variations. For example, here's a
case-insensitive search for "blort". Notice the upper case F?
F"blort"
Get the idea?
Finally, there are a few commands that can be used from MACROS.
~ this command inserts a DOS delay. The number preceding the command
is multiplied by 4, and this is the delay time in 1/50s of a sec.
For example,
13~
would delay for 1 second
This command is useful in combination with looped cursor movements for
automatic scrolling. For example, the following macro will advance
one page every 2 seconds until the end of the document is reached, or
the user clicks the left mouse button.
100000<25~[f]>
»»»»»»»»»»»»»»»»»»» ENABLING FEATURES WITHIN MACROS »»»»»»»»»»»»»»»»
19). Enabling Features within Macros
You can also explicitly turn on or off certain flags from MACROS. To turn
on a flag, use this command
+ This is followed by a letter to indicate which flag to affect
To turn off a flag, use this
- Same as the + command, but turns the flag off
Here are the letters which affect certain flags.
A = OverStrike
B = ExtendedOverstrike
C = Word Wrap
D = Mark Highlight
E = Auto-Indent
F = Block Search
G = Protect
H = Hide Cursor
I = Hide Printer Codes
J = Mouse On
L = Extra Wide
So, if you wanted to explicitly turn Overstrike on in a macro, do this:
+"A"
To turn Overstrike off, do this:
-"A"
You could even turn a flag on, and then off, etc in the same macro.
When set (+), the Hide Cursor flag turns off the orange text cursor. When
clear (-), the Mouse On flag makes the mouse pointer (red arrow) disappear.
It should be noted that changing these flags from a MACRO will not update
the disED OPTIONS menu unless you end your macro with the UPDATE MENU command
(v). This is generally a good thing to do if your use the + or - commands in
a macro. At any time, you can manually press CTRL-v to update the OPTIONS
menu. Do this if you think that some option is not properly checked due to a
macro changing the flags without updating.
You may also manually invoke these as commands. For example, hold down the
SHIFT and CTRL keys, and press +. The prompt "Flag to Set" will appear. Press
the L key for Extra Wide. Hold CTRL and press the - key. You will see "Flag
to Clear". Press the L key to cancel Extra Wide.
»»»»»»»»»»»»»»»»»»»»»»»»» LOADING/SAVING MACROS »»»»»»»»»»»»»»»»»»»»»»»»»
20). Load/Save Macros
Although the config file loads and saves all 30 macros, you can also load or
save individual macros via the SETUP menu's Macro item. This brings up the file
requester so that you can choose the filename and destination.
For example, to save the macro for the 1st SHIFTED function key:
1). Select the SETUP menu's Macro Save.
2). When you see the prompt "Press func key to SAVE", hold down the SHIFT
key and press F1.
3). When you see the prompt "Number of Macros >", simply hit return.
4). When the file requester comes up, choose the disk and filename to save
to and click on OK.
You can also save or load groups of macros. For example, here's how to save
the macros for Alt-F4, Alt-F5, and Alt-F6.
1). Select the SETUP menu's Macro Save.
2). When you see the prompt "Press func key to SAVE", hold down the ALT
key and press F4. This is the first macro to save in the file.
3). When you see the prompt "Number of Macros >1", press BACKSPACE to
delete the 1. Enter a 3 since we wish to save 3 function keys starting
at Alt-F4. Press RETURN.
4). When the file requester comes up, choose the disk and filename to save
to and click on OK. Let's call the file "ram:blort".
This saves the 3 macros for Alt-F4, Alt-F5, and Alt-F6 in one file. Now,
let's assume that you wish to load these 3 macros to function keys Shift-F1,
Shift-F2, and Shift-F3.
1). Select the SETUP menu's Macro Load.
2). When you see the prompt "Press func key to Load", hold down the SHIFT
key and press F1. This is where the first macro in the file is loaded.
3). When you see the prompt "Number of Macros >1", press BACKSPACE to
delete the 1. Enter a 3 since we wish to load 3 function keys starting
at Shift-F1. Press RETURN.
4). When the file requester comes up, choose "ram:blort".
This will erase whatever macros were in those 3 function keys, and load up
to 3 macros. Note that groups of macros must be on adjacent keys. You can't
save F1 and F3 without saving F2 in one file. Likewise, you can't load a macro
file in F1 and F4 without overwriting F2 and F3.
If you wish to load all the macros in a file, but are unsure how many
macros are in it, specify -1 for "Number of Macros". This will load all macros
in the file until there are no more macros, or until the function keys up to
Alt-F10 are filled. Note that if a file has 10 macros, and you start loading
at Alt-F5, only the first 5 macros in the file will be loaded because Alt-F10
is the last of the macros.
To save all 30 macros in one file, press F1 at the "Press func key to SAVE"
prompt, and specify 30 for "Number of Macros".
To load all 30 macros in one file, follow the same procedure.
»»»»»»»»»»»»»»»»»»»»»»»»»»»» COLOR CONTROL »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»
21). Color Control
The COLORS menu item under the setup menu brings up the dissidents' color
requester which can be used to adjust the colors of the window. The last two
colors affect the highlighted text and cursor colors, whereas the first two
colors control the background and regular text colors. The documentation and
examples for using the color requester in your own programs is available
from dissidents.
««««««««««««««««««««««««««« PRINTER CODES »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»
22). Printer Codes
Printer codes are a series of letters and numbers that specifically mean
something to your printer. They are commands that can tell your printer to
do such things as print text in italics, or change the color of the text
(provided that your printer supports this). The first character of a printer
code is always an escape character. This is hex $1B which when viewed in disED
is a reverse colored, right bracket ( [ ) character. This is a control code,
so to enter it into your document you first press CTRL and = keys, release
them, and follow by pressing the [ key. You should then see the reverse [.
What comes after this escape character depends upon which code you desire.
For example, the code to set italics is the escape character followed imme-
diately by these 3 characters:
[3m
Note that the first char is a right bracket, but not an escape character
because you do not press CTRL and = before entering it. If you were to send
this code to your printer, all subsequent text printed out would be in
italic print.
Normally, all printer codes are displayed wherever they occur in the
text, but if you turn on "Hide Codes" from the OPTIONS menu, disED will not
display any printer codes. Instead, disED will attempt to use the codes if
applicable, and ignore them otherwise. They still remain in your document,
but you can't see them. You will probably see the result of the codes, which
is how your printer would render such a document. disED understands the
following codes:
Boldface On
Italics On
Underline On
Normal char set (The above 3 off, and default colors)
nm The foreground (text) color where the "n" is replaced by
the color # you desire. For example,
sets the text
color to color #5 (i.e. the 6th color box of the color
requester).
nm The background color where the "n" is replaced by
the color # you desire. For example,
sets the background
color to color #0 (i.e. the first color box of the color
requester).
If you are reading this document in disED, then you should see these
printer codes. Now select "Hide Codes" from the OPTIONS menu. Notice how
you no longer see the printer codes, but the text after the printer codes
is affected. For example, the words "Italics On" occur after the Italics
On printer code, so they are rendered in italics. Select the Hide Codes
menu item several times to understand what is happening.
Turn off "Hide Codes" now (i.e. no check mark).
If you want to imbed printer codes in your document, there are a few
techniques that will improve the way the document looks in disED. First,
insert the printer code directly before any text that you wish to affect.
For example:
Underline me
would underline the words "Underline me" and continue underlining through
the remainder of the document. If you only want to underline those 2 words,
you need to cancel the underline immediately after the "me". You do this
with the Normal char set code.
Underline me
The normal char set code also cancels Boldface and Italics as well as
returns the colors to defaults of foreground=1 and background=0.
Study the following line. Try to imagine what it will look like with
Hide Codes on, then enable the feature.
I'm
starting
to
understand
this
.
When "Hide Codes" is on, and you are moving the cursor through the docu-
ment, the cursor key needs to be tapped twice to pass over a hidden printer
code. For example, enable the feature, move the cursor to the start of the
line "I'm starting to understand this.", and press the right cursor key
repeatedly. Note that when a printer code is encountered, the cursor doesn't
move forward until after the second press. Since the word "starting" has
several printer codes before it, the cursor appears "stuck" at the beginning
of the word for several presses. This is so that you can always tell where
printer codes are, and also allows you to step over it with the second key
press. The same thing is true when you cursor to the left (backwards).
Turn off "Hide Codes" now.
Sometimes, when you cursor backwards in the document (toward the top of
the window), certain lines will be redrawn without the proper printer code
effects. This is because printer codes are not designed to be read backwards
and in an effort to minimize overhead, disED does not make extraordinary
effort to do so. So, to check a document for proper formatting, always back
up before the area (printer code) you wish to check, and cursor forward.
The best approach is to write your text without any printer codes, setting
margins and formatting text as desired. Then, insert printer codes in one
of 2 manners.
1). To manually enter a code, have "Hide Codes" off so you can see what
you are typing. (Make sure that Word Wrap is off.) Temporarily, enable
"Hide Codes" to check the result and then disable again.
2). Leave "Hide Codes" on and program each function key to be one of the
codes you wish to insert. When you find where you want to insert a
code, press the appropriate function key. Do not attempt to manually
enter codes when "Hide Codes" is on, because as you enter the ESC
and "[" char, the editor may misinterpret subsequent text as part of
a printer code.
When in EXTRA WIDE text mode, disEd also "hides" (displays) the following
sub and super script printer codes.
v SuperScript Off
v SuperScript On
v SubScript Off
v SubScript On
v Normalize the line (i.e. cancel subscript or superscript)
Superscript letters are raised slightly higher than surrounding, normal
text. Subscript letters are lowered.
disED ignores these codes when not in EXTRA WIDE mode because there is not
enough room in between lines to show sub and super scripts. Enable HIDE CODES
and EXTRA WIDE, and see the effect on the following lines.
Rv12 v* I = Vvtv An example of OHMS LAWv1v
v1v This is a footnote.
»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»» FINAL NOTES »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»
23). Final Notes
To use the disED editor, you must copy the following files to the libs
drawer of your boot disk:
text_ed.library
disED.library
requester.library
color.library (only if you want to be able to change the window colors).
For WorkBench users, you should click on the "Click Me First" icon, once
only.
CLI users can CD to the dir with "InstallLibs" in it and execute this
script.
If you've ever worked on large files in some text editors, you may have
noticed that inputting chars is excruciatingly slow. disEd buffers the current
line at certain times, thus making it appear as if each line is part of a
very small file. This greatly reduces the impression that the amount of text
being manipulated is unwieldy, yet makes for a very memory efficient program.
In fact, you may be surprised that even with the FileIO and text_ed libraries
considered (which can be used by a great many applications), the disED editor
is not that much larger than ED. At about 29K total, it certainly is smaller
than those EMACS things, and considering the amount of features, it should win
a place on any development disk.
The disED front-end to the library is not re-entrant, even though the
library itself is. This means that for every invocation of disED, about 6K of
code and data is added. This may actually result in little more memory use than
a fully re-entrant editor since disED does not need to make copies of menus and
other structures when loaded (unlike most re-entrant programs). Do not make
disED resident!
Note that you can start a new editor from within disED by invoking the
DOS COMMAND CTRL-\, and typing
run disED
at the title bar prompt, or by using the equivalent macro in a function key
\"run disED"
»»»»»»»»»»»»»»»»»»»»»»»»»»»» EDITOR VERSIONS »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»
24). Editor Versions
An enhanced version of disED, called deluxED, is also included. This editor
has additional features that CLI users or programmers may not need. Because of
these extra features, deluxED is slightly larger than disED on disk. When
loaded, deluxED also uses up more memory because it opens up an 8 color, custom
screen. All of the deluxED editors open on this one screen, but with different
window colors so that you can easily distinguish between them.
All of the commands of disED are supported, with the addition of menus to
access the commands. In this way, you may use either the CTRL key combo or a
menu to implement any command. Each menu item shows the CTRL key combo that
invokes the command. For example, the "Delete Line" menu item looks like this:
Delete Line ^d
The ^d means to hold down the CTRL key while you press d. This version is
useful for when you are starting to learn the disED command set.
Each item in the Strings menu has two CTRL combos listed. For example, the
EXCHANGE item is:
Exchange ^e/^E
The first combo (^e) is a case-sensitive search and exchange.
The second combo (^E) is for the case-insensitive search and exchange.
Also, a version of deluxED, called deluxEDplus has even more features.
Primarily, this version allows you to fully re-configure the command set.
You can set up the editor so that an EMACS, WORDSTAR, or other command set
is implemented. This is provided for those unfortunate souls who are still
using an obsolete editor at work, and want to duplicate that environment at
home. They haven't yet realized that the time it takes to adjust to more
efficient software will be more than offset by increased productivity.
deluxEDplus has an additional item under the SETUP menu, "Rebind Key".
Select this item and you will be prompted to choose the menu item to bind
to a key sequence. For example, let's say that we wish to invoke the "Set
Mark" item by pressing the ESC, A, and J keys. Here is the procedure:
1). Select "Rebind key" under the SETUP menu. The title bar reads
"Select the Menu Item to rebind"
2). Select the "Set Mark" item under the CLIP menu. The title bar reads
"Press the new key sequence, and then release the keys"
3). Press and hold down the ESC key. Press the A, and then the J key. Re-
lease the ESC key.
The title bar should read "Rebind OK" if all went well. Now, when
you hold ESC, then press A, and J, the mark should be set.
There are a few rules in choosing the key sequence. The first key must be
the ESC, CTRL, right AMIGA, or left AMIGA key. You may then press up to 3 other
keys (except ESC only allows 2 other keys). You may even press the ALT or SHIFT
keys as well.
You may even combine ESC, CTRL, and the AMIGA keys together in a command
sequence. For example, a command can be invoked with this sequence:
CTRL, ESC, SHIFT, right AMIGA, S, P, L
Wonderful! This is even more inefficient than the editor you may be using
at work! And if that's what you had learned, you wouldn't want to change for
any reason, right?
Note that the CTRL, ESC, SHIFT, AMIGA, and ALT keys are not part of the 3
key limit.
If you try to bind the same key sequence to more than 1 menu item, the
highest priority menu item will overide the other. Highest priority items
are in the Project menu, and subsequent menus have lower priority. When
creating a new command set, it is best to start with the first item in the
Project menu, and continue all the way to the last item in the Function menu.
Note that you can only rebind the subitems of a menu item if it has subitems.
For example, you cannot rebind the "Save AS" item, but you can rebind its
two subitems "File" and "Clip", one at a time.
Also note that one command cannot contain another command sequence within
it. For example, if you define GOTO LINE as CTRL-g, then you cannot define
SWAP POSITION as CTRL-x-g.
There are two config files that implement EMACS and WORDSTAR command sets.
Some commands are not directly supported by deluxEDplus, so Macros were made
for the ALT-Function keys. deluxEDplus has a FUNCTION menu which allows you
to bind Macros for the 10 ALT-Function keys to other keys. In this way, the
other command sets can be better simulated. You still have the 10 regular and
SHIFTED function keys for Macros, although these cannot be rebound to other
key combos. If you change any one of the ALT-function macros, that will also
change the operation of any command sequence bound to it.
Note that the rebound keys are saved in a configuration file, so be sure
to save a config file after rebinding.
»»»»»»»»»»»»»»»»»»»»»»»»»» WHAT'S AVAILABLE »»»»»»»»»»»»»»»»»»»»»»»»»»»
25). What's Available
There are several dissidents libraries out including the FileIO requester
library, a color requester library, an ilbm/iff reader/writer library, our
16-bit sampled sound reader/writer lib (SAMP), and now the text_ed library.
You should be able to locate the libs, docs, includes, and examples in C,
assembly, and AmigaBasic on various Fish disks. dissidents has now made
available a disk that contains all of the latest versions of the libraries
along with all documentation. Also available (by request) are a few perks
such as post-script versions of the doc files. You know, the actual chapters
right out of the SpeakerSim and Midi SampleWrench manuals as laid out in
Professional Page. We are making these available as a courtesy to fellow amiga
programmers and are not trying get rich off of this deal. If you are interested
in obtaining copies of the "dissidents custom libraries disk", contact
dissidents
730 Dawes Avenue
Utica, NY 13502
(315) 797-0343
or
Jeff Glatt
6 Sycamore Drive East
New Hartford, NY 13413